package com.neo.base

import scala.concurrent.Future

/**
  * Created by hadoop on 6/16/17.
  */

class Upper {
  def upper(strings: String*): Seq[String] = {
    strings.map((s:String) => s.toUpperCase())
  }
}
object MapTest {
  def AddSelf(x : Int): Int ={
    x * 10
  }

  def main(args: Array[String]): Unit = {
    val up  = new Upper
    println(up.upper("Hello", "World!"))

    //println((1 to 10) flilter (_ % 2 == 0) map (_ * 2) reduce (_ * _))

    val array1 = Array(1,2,3,4,5)

    //println(array1.map(_ * 2).apply(0))

    val newarray  = array1.map(AddSelf)

    newarray.foreach(println)

    val sum = newarray.reduce(_ - _)

    println(sum)

    println("__________________________________________________")
    val str = "100000"
    val strs = str.map(a => a * 10)

    strs.foreach(a => println(a))
    val aaa: Long = 1111111111111111111L

    val sum3 = strs.reduce((a,b)=> a % b)
    println(sum3)





  }
}
